package projectdemo01.user;

import projectdemo01.operation.*;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:咭咭熊
 * Date:2021 - 09 - 23
 * Time:19:28
 */
//管理员
public class AdminUser extends User{

    public AdminUser(String name) {
        super(name);
        //此数组中包含管理员对书籍进行的增删查改操作
        this.operations = new IOperation[]{
                new ExitOperation(),
                new FindOperation(),
                new AddOperation(),
                new DelOperation(),
                new DisplayOperation()

        };
    }

    /***
     * 根据返回的选择去执行对应的操作
     * @return
     */
    @Override
    public int menu() {
        Scanner scanner = new Scanner(System.in);
        /*System.out.println("管理员的菜单页面");*/
        System.out.println("==============================");
        System.out.println("hello " +  this.name + "欢迎来到图书管理系统");
        System.out.println("1.查找书籍");
        System.out.println("2.新增图书");
        System.out.println("3.删除图书");
        System.out.println("4.显示图书");
        System.out.println("0.退出系统");
        System.out.println("==============================");
        int choice = scanner.nextInt();
        return choice;
    }


}
